package com.docker.jy.service.impl;

import java.util.List;
import java.util.Map;

import com.docker.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.docker.jy.mapper.DoctorAchievementMapper;
import com.docker.jy.domain.DoctorAchievement;
import com.docker.jy.service.IDoctorAchievementService;

/**
 * 医生业绩统计Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-15
 */
@Service
public class DoctorAchievementServiceImpl implements IDoctorAchievementService 
{
    @Autowired
    private DoctorAchievementMapper doctorAchievementMapper;

    /**
     * 查询医生业绩统计
     * 
     * @param id 医生业绩统计主键
     * @return 医生业绩统计
     */
    @Override
    public DoctorAchievement selectDoctorAchievementById(Long id)
    {
        return doctorAchievementMapper.selectDoctorAchievementById(id);
    }

    /**
     * 查询医生业绩统计列表
     * 
     * @param doctorAchievement 医生业绩统计
     * @return 医生业绩统计
     */
    @Override
    public List<DoctorAchievement> selectDoctorAchievementList(DoctorAchievement doctorAchievement)
    {
        return doctorAchievementMapper.selectDoctorAchievementList(doctorAchievement);
    }

    /**
     * 新增医生业绩统计
     * 
     * @param doctorAchievement 医生业绩统计
     * @return 结果
     */
    @Override
    public int insertDoctorAchievement(DoctorAchievement doctorAchievement)
    {
        doctorAchievement.setCreateTime(DateUtils.getNowDate());
        return doctorAchievementMapper.insertDoctorAchievement(doctorAchievement);
    }

    /**
     * 修改医生业绩统计
     * 
     * @param doctorAchievement 医生业绩统计
     * @return 结果
     */
    @Override
    public int updateDoctorAchievement(DoctorAchievement doctorAchievement)
    {
        return doctorAchievementMapper.updateDoctorAchievement(doctorAchievement);
    }

    /**
     * 批量删除医生业绩统计
     * 
     * @param ids 需要删除的医生业绩统计主键
     * @return 结果
     */
    @Override
    public int deleteDoctorAchievementByIds(Long[] ids)
    {
        return doctorAchievementMapper.deleteDoctorAchievementByIds(ids);
    }

    /**
     * 删除医生业绩统计信息
     * 
     * @param id 医生业绩统计主键
     * @return 结果
     */
    @Override
    public int deleteDoctorAchievementById(Long id)
    {
        return doctorAchievementMapper.deleteDoctorAchievementById(id);
    }

    //查询doctor_id和totalcost统计列表
    @Override
    public List<Map> selectDoctorIdAndTotalcost(){
        List<Map> doctorAchievements = doctorAchievementMapper.selectDoctorIdAndTotalcost();
        System.out.println(doctorAchievements);
        return doctorAchievements;
    }

    //查询doctor_id和totalcost统计列表
    @Override
    public List<Map> selectDoctorIdAndPatientId(){
        List<Map> doctorAchievements = doctorAchievementMapper.selectDoctorIdAndPatientId();
        System.out.println(doctorAchievements);
        return doctorAchievements;
    }
}
